{template "nheader.html"}
<script type="text/javascript">
	$(function() {
		dr_theme({$is_theme});
	});
	function dr_theme(id) {
		if (id == 1) {
			$("#dr_theme_html").html($("#dr_web").html());
		} else {
			$("#dr_theme_html").html($("#dr_local").html());
		}
	}
</script>
<div id="dr_local" style="display: none">
	<label class="col-md-2 control-label">{fc_lang('主题风格')}：</label>
	<div class="col-md-9">
		<label><select class="form-control" name="data[theme]">
			<option value="default"> -- </option>
			{loop $theme $t}
			<option{if $t==$data['site'][$sid]['theme']} selected=""{/if} value="{$t}">{$t}</option>
			{/loop}
		</select></label>
		<span class="help-block">{fc_lang('位于网站主站根目录下：根目录/statics/风格名称/')}</span>
	</div>
</div>
<div id="dr_web" style="display: none">
	<label class="col-md-2 control-label">{fc_lang('远程资源')}：</label>
	<div class="col-md-9">
		<input class="form-control  input-xlarge" type="text" placeholder="http://" name="data[theme]" value="{php echo strpos($data['site'][$sid]['theme'], 'http') === 0 ? $data['site'][$sid]['theme'] : '';}">
		<span class="help-block">{fc_lang('网站将调用此地址的css,js,图片等静态资源')}</span>
	</div>
</div>
<div class="page-bar">
	<ul class="page-breadcrumb mylink">
		{$menu.link}

	</ul>
	<ul class="page-breadcrumb myname">
		{$menu.name}
	</ul>
	<div class="page-toolbar">
		<div class="btn-group pull-right">
			<button type="button" class="btn green btn-sm btn-outline dropdown-toggle" data-toggle="dropdown" aria-expanded="false" data-hover="dropdown"> {fc_lang('操作菜单')}
				<i class="fa fa-angle-down"></i>
			</button>
			<ul class="dropdown-menu pull-right" role="menu">
				{loop $menu.quick $t}
				<li>
					<a href="{$t.url}">{$t.icon} {$t.name}</a>
				</li>
				{/loop}
				<li class="divider"> </li>
				<li>
					<a href="javascript:window.location.reload();">
						<i class="icon-refresh"></i> {fc_lang('刷新页面')}</a>
				</li>
			</ul>
		</div>
	</div>
</div>
<h3 class="page-title">
	<small>{fc_lang('模块支持安装到多个站点之中，支持绑定独立域名，自定义在字段可以共享，数据可以同步')}</small>
</h3>

<form class="form-horizontal" action="" method="post" id="myform" name="myform">
	<div class="portlet light bordered myfbody">
		<div class="portlet-title tabbable-line">
			<ul class="nav nav-tabs" style="float:left;">
				{if !$data.share}
				<li class="active">
					<a href="#tab_0" data-toggle="tab"> <i class="fa fa-cog"></i> {fc_lang('站点配置')} </a>
				</li>
				<li class="">
				{else}
				<li class="active">
				{/if}
				<li class="">
					<a href="#tab_1" data-toggle="tab"> <i class="fa fa-internet-explorer"></i> {fc_lang('SEO设置')} </a>
				</li>
				{if $mycfg}
				<li class="">
					<a href="#tab_2" data-toggle="tab"> <i class="fa fa-cog"></i> {fc_lang('我的配置')} </a>
				</li>
				{/if}
			</ul>
		</div>
		<div class="portlet-body">
			<div class="tab-content">

				<div class="tab-pane {if !$data.share}active{/if}" id="tab_0">
					<div class="form-body">

						<div class="form-group ">
							<label class="col-md-2 control-label">{fc_lang('网站名称')}：</label>
							<div class="col-md-9">
								<div class="form-control-static"><label>{$ci->site_info[$sid]['SITE_NAME']}</label></div>
							</div>
						</div>

						<div class="form-group">
							<label class="col-md-2 control-label" style="padding-top:10px">{fc_lang('风格模式')}：</label>
							<div class="col-md-9">
								<div class="radio-list">
									<label class="radio-inline"><input type="radio" onclick="dr_theme(1)" name="theme" value="1" {if $is_theme}checked{/if} /> {fc_lang('远程地址')}</label>
									<label class="radio-inline"><input type="radio" onclick="dr_theme(0)" name="theme" value="0" {if !$is_theme}checked{/if} /> {fc_lang('本站资源')}</label>
								</div>
								<span class="help-block">{fc_lang('可以将js,css,图片存储在远程地址或者本地statics目录之中')}</span>
							</div>
						</div>
						<div class="form-group" id="dr_theme_html">

						</div>
						<div class="form-group ">
							<label class="col-md-2 control-label">{fc_lang('模板目录')}：</label>
							<div class="col-md-9">
								{if $template_path}
								<label><select class="form-control" name="data[template]">
									<option value="default"> -- </option>
									{loop $template_path $t}
									<option{if $t==$data['site'][$sid]['template']} selected=""{/if} value="{$t}">{$t}</option>
									{/loop}
								</select></label>
								<span class="help-block">{fc_lang('核心目录/module/%s/templates/目录名称/，用于存储html模板页面', $data.dirname)}</span>
								{else}
								<div class="form-control-static"><label>{fc_lang('核心目录/dayrui/templates/%s/%s/', $ci->site_info[$sid]['SITE_TEMPLATE'], $data.dirname)}</label></div>
								{/if}
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-2 control-label">{fc_lang('生成静态')}：</label>
							<div class="col-md-9">
								<div class="radio-list">
									<label class="radio-inline"><input type="radio" name="data[html]" value="1" {if $data['site'][$sid]['html']}checked{/if} /> {fc_lang('开启')}</label>
									<label class="radio-inline"><input type="radio" name="data[html]" value="0" {if !$data['site'][$sid]['html']}checked{/if} /> {fc_lang('关闭')}</label>
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-2 control-label">{fc_lang('URL规则')}：</label>
							<div class="col-md-9">
								<label>
									<select class="form-control" name="data[urlrule]">
										<option value="0"> -- </option>
										{list action=cache name=urlrule return=u}
										{if $u.type==1}<option value="{$u.id}" {if $u.id==$data['site'][$sid]['urlrule']}selected{/if}> {$u.name} </option>{/if}
										{/list}
									</select>
								</label>
								<label>&nbsp;&nbsp;{fc_lang('<a href="'.dr_url('urlrule/index').'" style="color:blue !important">[URL规则管理]</a>')}</label>
							</div>
						</div>
						<div class="form-group ">
							<label class="col-md-2 control-label">{fc_lang('绑定域名')}：</label>
							<div class="col-md-9">

							</div>
						</div>
						{if $sid > 1}
						<div class="form-group dr_site_{$sid}" {if !$data['site'][$sid]['use']}style="display:none"{/if}>
							<label class="col-md-2 control-label" style="color:red;">{fc_lang('生成时绑定目录')}：</label>
							<div class="col-md-9" style="color:red;">
								<div class="form-control-static"><label>{WEBPATH}html/{$sid}/</label></div>
							</div>
						</div>
						{/if}
					</div>
				</div>

				<div class="tab-pane {if $data.share}active{/if}" id="tab_1">
					<div class="form-body">

						<div class="form-group">
							<label class="col-md-2 control-label">Title：</label>
							<div class="col-md-9">
								<input class="form-control" type="text" name="data[module_title]" value="{$data['site'][$sid]['module_title']}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-2 control-label">Keywords：</label>
							<div class="col-md-9">
								<input class="form-control" type="text" name="data[module_keywords]" value="{$data['site'][$sid]['module_keywords']}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-2 control-label">Description：</label>
							<div class="col-md-9">
								<input class="form-control" type="text" name="data[module_description]" value="{$data['site'][$sid]['module_description']}" >
							</div>
						</div>
					</div>
				</div>

				{if $mycfg}
				<div class="tab-pane " id="tab_2">
					{load $mycfg}
				</div>
				{/if}
			</div>
		</div>
	</div>

	<div class="myfooter">
		<div class="row">
			<div class="portlet-body form">
				<div class="form-body">
					<div class="form-actions">
						<div class="row">
							<div class="col-md-12 text-center">
								<button type="submit" class="btn green"> <i class="fa fa-save"></i> {fc_lang('保存')}</button>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</form>
{template "nfooter.html"}